package jwebtester.dal.entities;

// Generated Oct 31, 2012 3:54:40 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * UserEntity generated by hbm2java
 */
@Entity
@Table(name = "USERS", schema = "PUBLIC", catalog = "PUBLIC")
public class UserEntity implements java.io.Serializable {

	private Integer id;
	private OrganizationEntity organizationEntity;
	private String firstName;
	private String lastName;
	private boolean isDisabled;
	private boolean isDeleted;
	private Set<ExpertsEntity> expertsEntitiesForUserId = new HashSet<ExpertsEntity>(0);
	private Set<UsersRolesEntity> usersRolesEntities = new HashSet<UsersRolesEntity>(0);
	private Set<AuthenticationEntity> authenticationEntities = new HashSet<AuthenticationEntity>(0);
	private Set<ExpertsEntity> expertsEntitiesForAssignedBy = new HashSet<ExpertsEntity>(0);
	private Set<ExpertGroupEntity> expertGroupEntities = new HashSet<ExpertGroupEntity>(0);
	private Set<CompetencyModelHistoryEntity> competencyModelHistoryEntities = new HashSet<CompetencyModelHistoryEntity>(
			0);

	public UserEntity() {
	}

	public UserEntity(OrganizationEntity organizationEntity, boolean isDisabled, boolean isDeleted) {
		this.organizationEntity = organizationEntity;
		this.isDisabled = isDisabled;
		this.isDeleted = isDeleted;
	}

	public UserEntity(OrganizationEntity organizationEntity, String firstName, String lastName,
			boolean isDisabled, boolean isDeleted, Set<ExpertsEntity> expertsEntitiesForUserId,
			Set<UsersRolesEntity> usersRolesEntities,
			Set<AuthenticationEntity> authenticationEntities,
			Set<ExpertsEntity> expertsEntitiesForAssignedBy,
			Set<ExpertGroupEntity> expertGroupEntities,
			Set<CompetencyModelHistoryEntity> competencyModelHistoryEntities) {
		this.organizationEntity = organizationEntity;
		this.firstName = firstName;
		this.lastName = lastName;
		this.isDisabled = isDisabled;
		this.isDeleted = isDeleted;
		this.expertsEntitiesForUserId = expertsEntitiesForUserId;
		this.usersRolesEntities = usersRolesEntities;
		this.authenticationEntities = authenticationEntities;
		this.expertsEntitiesForAssignedBy = expertsEntitiesForAssignedBy;
		this.expertGroupEntities = expertGroupEntities;
		this.competencyModelHistoryEntities = competencyModelHistoryEntities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORGANIZATION_ID", nullable = false)
	public OrganizationEntity getOrganizationEntity() {
		return this.organizationEntity;
	}

	public void setOrganizationEntity(OrganizationEntity organizationEntity) {
		this.organizationEntity = organizationEntity;
	}

	@Column(name = "FIRST_NAME", length = 128)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "LAST_NAME", length = 128)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "IS_DISABLED", nullable = false)
	public boolean isIsDisabled() {
		return this.isDisabled;
	}

	public void setIsDisabled(boolean isDisabled) {
		this.isDisabled = isDisabled;
	}

	@Column(name = "IS_DELETED", nullable = false)
	public boolean isIsDeleted() {
		return this.isDeleted;
	}

	public void setIsDeleted(boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntityByUserId")
	public Set<ExpertsEntity> getExpertsEntitiesForUserId() {
		return this.expertsEntitiesForUserId;
	}

	public void setExpertsEntitiesForUserId(Set<ExpertsEntity> expertsEntitiesForUserId) {
		this.expertsEntitiesForUserId = expertsEntitiesForUserId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<UsersRolesEntity> getUsersRolesEntities() {
		return this.usersRolesEntities;
	}

	public void setUsersRolesEntities(Set<UsersRolesEntity> usersRolesEntities) {
		this.usersRolesEntities = usersRolesEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<AuthenticationEntity> getAuthenticationEntities() {
		return this.authenticationEntities;
	}

	public void setAuthenticationEntities(Set<AuthenticationEntity> authenticationEntities) {
		this.authenticationEntities = authenticationEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntityByAssignedBy")
	public Set<ExpertsEntity> getExpertsEntitiesForAssignedBy() {
		return this.expertsEntitiesForAssignedBy;
	}

	public void setExpertsEntitiesForAssignedBy(Set<ExpertsEntity> expertsEntitiesForAssignedBy) {
		this.expertsEntitiesForAssignedBy = expertsEntitiesForAssignedBy;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<ExpertGroupEntity> getExpertGroupEntities() {
		return this.expertGroupEntities;
	}

	public void setExpertGroupEntities(Set<ExpertGroupEntity> expertGroupEntities) {
		this.expertGroupEntities = expertGroupEntities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "userEntity")
	public Set<CompetencyModelHistoryEntity> getCompetencyModelHistoryEntities() {
		return this.competencyModelHistoryEntities;
	}

	public void setCompetencyModelHistoryEntities(
			Set<CompetencyModelHistoryEntity> competencyModelHistoryEntities) {
		this.competencyModelHistoryEntities = competencyModelHistoryEntities;
	}

}
